package com.qf.qfcenterservice.api;

import com.qf.common.feigns.MenuApi;
import com.qf.common.model.QfMenu;
import com.qf.qfcenterservice.service.MenuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Slf4j
public class MenuFeignApi implements MenuApi {

    @Autowired
    private MenuService menuService;

    @GetMapping("/api/menu/all")
    @Override
    public List<QfMenu> findAllMenu() {
        List<QfMenu> list = menuService.list();

        log.info("menuList:{}",list);

        return list;
    }
}
